package com.atguigu.bigdata.spark.core.rdd.io

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
  * create by undeRdoG on  2021-06-14  17:36
  * 凡心所向，素履以往，生如逆旅，一苇以航。
  */
object Spark01_RDD_Load {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf().setAppName("Partition").setMaster("local[*]")

    val sc = new SparkContext(sparkConf)

    val rdd1: RDD[String] = sc.textFile("io/output1")
    println(rdd1.collect().mkString(","))

    val rdd2: RDD[(String,Int)] = sc.objectFile("io/output2")
    println(rdd2.collect().mkString(","))


    val rdd3: RDD[(String, Int)] = sc.sequenceFile[String,Int]("io/output3")
    println(rdd3.collect().mkString(","))
  }
}
